﻿using Project.Ycm20250401.Service._20250407;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.Ycm20250401.Service._20250409
{
    public class OrderManager
    {
        private readonly IEnumerable<IOrderObserver> _observers;

        public OrderManager(IEnumerable<IOrderObserver> observers)
        {
            _observers = observers;
        }

        public async Task PlaceOrderAsync(Order20250409 order)
        {
            Console.WriteLine($"Order placed with ID: {order.OrderId}");

            foreach (var observer in _observers)
            {
                 observer.Update(order);
            }
        }
    }
}
